import pymysql

# 连接mysql(socket) db = 'study1' = 自动执行ues study1; --进入数据库
conn = pymysql.connect(host="139.159.152.73", port=3306, user='root', passwd='Python666..', charset='utf8')
cursor = conn.cursor()

# 新增（需要commit）
user = input("请输入用户名：")
assword = input("请输入密码：")
sqll = "CREATE USER %s@'139.159.152.73' IDENTIFIED BY %s;"
cursor.execute(sqll, (user, assword))
conn.commit()

cursor.close()
conn.close()
